package com.niit.RPCServer;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.ipc.RPC;

public class Starter {
    public static void main(String[] args) {
        try {
            RPC.Builder builder = new RPC.Builder(new Configuration());
            builder.setBindAddress("localhost").setPort(1000).setProtocol(LoginServiceInterface.class).setInstance(new LoginServiceImpl());
            RPC.Server server = builder.build();
            System.out.println(server.getListenerAddress().toString());
            System.out.println(server.getPort());
            System.out.println(server.getNumDroppedConnections());
            server.start();

        }catch (Exception e){
            System.out.println(e.getMessage());
        }
    }
}
